Developer Documentation
PATH  WebObjects 4.5 Documentation > Getting Started With Direct to Java Client

   

Creating a Direct to Java Client Project

Direct to Java Client isn't yet fully integrated into Project Builder like other WebObjects technologies, so you don't create Direct to Java Client projects the same way you create other kinds of projects. Instead of creating a new project in Project Builder, you copy a template project, make a few modifications, and proceed from there as you normally would.

The following steps describe the process for the tutorial application.

  1. Copy the DirectToJavaClientTemplate project directory to a working directory.

    The DirectToJavaClientTemplate project directory is located in /System/Developer/Examples/WebObjects/JavaClient (Mac OS X Server) or $NEXT_ROOT/Developer/Examples/WebObjects/JavaClient (Windows). Make a copy of the project in your development directory. This tutorial uses /tmp (MacOS X Server) or C:/tmp (Windows).

  2. Open your copy of the project.

    Navigate to your copy of the project directory, and open the PB.project file. This opens the project in Project Builder, starting Project Builder first if it isn't already running.

  3. Change the name of your project to "D2JCTutorial".

    Open Project Builder's Project Attributes inspector: Choose Tools Inspector to open the inspector panel and choose Project Attributes in the upper pull-down list to switch to the Project Attributes view.

    Type D2JCTutorial in the Name field and press Return. Click Yes when Project Builder asks whether to rename the project folder too.

  4. Rename the main file to D2JCTutorial_main.m.

    In the Other Sources bucket of your project, select the DirectToJavaClientTemplate_main.m file. Choose File Rename, and change the file's name to D2JCTutorial_main.m. (The main file name should be based on the project name: ProjectName_main.m.)

    Direct to Java Client technology uses model files to generate applications. To make models available to Direct to Java Client, you add them to your project. You can either add models directly to your project by adding them to the Resources suitcase, or you can add them indirectly by adding frameworks that contain your models.

    The models used by this tutorial application are the Movies and Rentals models that describe the Movies database. These models are contained in the BusinessLogicJava framework, which provides server side business logic implemented in custom enterprise objects. The corresponding client side objects are provided by the BusinessLogicClient framework, which this tutorial application also uses.

  5. Add BusinessLogicJava.framework and BusinessLogicClient.framework to your project.

    Double click the Frameworks suitcase of your project. In the Add Frameworks panel, navigate to /Local/Library/Frameworks (Mac OS X Server) or $(NEXT_ROOT)/Local/Library/Frameworks (Windows). Choose BusinessLogicJava.framework, and click OK. Click Add when Project Builder asks whether to add the Local/Library/Frameworks directory to your Framework Search Order.

    Repeat to add BusinessLogicClient.framework, which is in the same directory.

What's in the Template Project?


© 1999 Apple Computer, Inc. – (Draft. Last updated 05 Jan 00)